package cn.chinaflame.pagodas.entity;
import javax.persistence.*;
import java.util.Objects;
import javax.persistence.*;
/**
 * @author created by lbq
 * @date 2018年1月4日 下午2:31:09
 **/
@Entity
@Table(name = "yw_area", schema = "pagoda", catalog = "")
public class YwArea {
    private String code;
    private String name;
    private String parentCode;
    private String type;
    private String createtime;
    private String updatetime;

    @Id
    @Column(name = "code", nullable = false, length = 10)
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "name", nullable = true, length = 20)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "parent_code", nullable = true, length = 10)
    public String getParentCode() {
        return parentCode;
    }

    public void setParentCode(String parentCode) {
        this.parentCode = parentCode;
    }

    @Basic
    @Column(name = "type", nullable = true, length = 1)
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @Column(name = "createtime", nullable = true)
    public String getCreatetime() {
        return createtime;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    @Basic
    @Column(name = "updatetime", nullable = true)
    public String getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(String updatetime) {
        this.updatetime = updatetime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        YwArea ywArea = (YwArea) o;
        return Objects.equals(code, ywArea.code) &&
                Objects.equals(name, ywArea.name) &&
                Objects.equals(parentCode, ywArea.parentCode) &&
                Objects.equals(type, ywArea.type) &&
                Objects.equals(createtime, ywArea.createtime) &&
                Objects.equals(updatetime, ywArea.updatetime);
    }

    @Override
    public int hashCode() {

        return Objects.hash(code, name, parentCode, type, createtime, updatetime);
    }
}
